<template>
	<div class="address">
    我的年龄是{{ parentAge }}
    <casader :deliverParentAge="parentAge"
      @changeValue3="handleAddParentAge"
      ref="child"
    ></casader>
    <casader :deliverParentAge="parentAge"
      @changeValue3="handleAddParentAge"
      ref="child2"
    ></casader>
    <el-button @click="a">回填</el-button>
    <el-button @click="b">查询</el-button>
  </div>
</template>

<script>
import axios from "axios";
import Casader from '../components/cascaderD';
export default {
  components: { Casader },
  data() {
    return {
      parentAge:["广东省", "深圳市", "南山区", "铁东街道"]
    };
  },
  created() {},
  mounted() {},
  methods: {
    handleAddParentAge(actualAge) {
      console.log("父组件的实际年龄是：", actualAge);
    },
    //回填
    a(){
      //this.$refs.child.$emit('changeValue2','发送给方法一的数据') // 方法1:触发监听事件
      let b = ["北京市", "北京城区", "怀柔区", "泉河街道"];
      this.$refs.child.changeValue2(b) // 方法2:直接调用
    },
    //获取
    b(){
      let res = this.$refs.child.cx() // 方法2:直接调用
      console.log(res);
    },
  }
};
</script>

<style scoped lang="scss">

</style>
